#include <SPI.h>
#include <SD.h>
#include <vector>
#include "svm_predict.h"

// change this to match your SD shield or module;
const int chipSelect = 4;

void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  
  Serial.print("Initializing SD card...");
  
  if (!SD.begin(chipSelect)) {
    Serial.println("initialization failed!");
    return;
  }
  
  Serial.println("initialization done.");
  int index = 1;
  PredictGesture();
  Serial.println("第" + String(index) + "次识别完成");
  index++;
  // delay(5000);
}

void loop()
{
}

//调用模型识别手势
void PredictGesture()
{
	int paramNumberPredict = 4;
	char* tmp[] = {"", "point.txt", "model.txt", "result.txt"};

	Serial.println("* 【调用模型文件为 modelall.txt 】 *");
	svmPredict(paramNumberPredict, tmp);
}